﻿<title>旺进财</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width,height=device-height,inital-scale=1.0,maximum-scale=1.0,user-scalable=no;">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">
<script type="text/javascript" src="#(assets)/js/jquery-2.2.4.min.js"></script>
<script type="text/javascript" src="#(assets)/js/app.js"></script>
<script type="text/javascript" src="#(assets)/js/layer/layer.js"></script>
<style>
	*{font-family:"Microsoft YaHei",Arial,Helvetica,sans-serif,"SimSun";}
	select,input{-webkit-appearance:none;border:0px;
		-webkit-tap-highlight-color: rgba(0, 0, 0, 0);   
	}
</style>


<body bgcolor="#f8f8f8" style="margin:0px;">
	#@homemenu("reg")
	<div align="center" style="width:100%">
		<div align="center" style="background:#FFF;width:700px;padding:20px;margin-top:30px;padding-bottom:80px;">
			<img style="" src="/assets/home/user/reg_logo2.jpg">
			<div>
				<p>  
				<span style="font-size:26px;">免费注册旺进财账户</span>  
				<p><span style="font-size:18px;">已有账户？</span><span onclick="window.location.href='#(path)/user-login'" style="cursor:pointer;font-size:18px;color:#fd4159">登录</span></p>
			</div> 
			<div> 
				<input placeholder="手机号" id="mobile" style="border:1px solid #cbcbcb;background-size:30px 30px;background:url(#(path)/assets/home/user/reg_img1.png) no-repeat 15px 6px;border-radius:8px;padding-left:40px;height:40px;width:280px;font-size:16px;" type="tel" />
			</div>
			<div style="margin-top:20px;">
				<input placeholder="密码(6-12位数字或字母组合)"  id="password" style="border:1px solid #cbcbcb;background-size:30px 30px;background:url(#(path)/assets/home/user/reg_img3.png) no-repeat 15px 6px;border-radius:8px;padding-left:40px;height:40px;width:280px;font-size:16px;" type="password"  />
			</div> 
			
			<div style="width:280px;height:50px;margin-top:20px;">
				<input placeholder="输入验证码" id="code" style="float:left;border-radius:8px 0 0 8px;border:1px solid #cbcbcb;padding-left:35px;height:40px;width:150px;font-size:16px;" type="tel"  />
				<input id="log_getcode" style="background:#FFF;float:left;border:1px solid #cbcbcb;border-left:0px;border-radius:0 8px 8px 0;color:#fb4357;height:40px;width:130px;;font-size:16px;" value="获取验证码" type="button"  /> 
			</div>
			<div align="left" style="margin-top:15px;margin-left:210px;">
				<img style="width:13px;margin-right:10px;" src="#(path)/assets/home/user/reg_img6.png"><span style="color:#fd4456">推荐人手机号码（选填）</span>
			</div>
			<div style="margin-top:10px;">
				<input placeholder="推荐人手机号码" id="referee" style="border:1px solid #cbcbcb;background-size:30px 30px;background:url(#(path)/assets/home/user/reg_img5.png) no-repeat 15px 6px;border-radius:8px;padding-left:40px;height:40px;width:280px;font-size:16px;" type="tel"  />
			</div> 
			
			<div align="left"style="clear:both;width:280px;margin-top:10px;"> 
				<input id="xieyi" type="checkbox" style="vertical-align:middle;-webkit-appearance:checkbox;border:1px solid #000;height:15px;width:15px;" value="" />
				<span style="font-size:13px;">我已经阅读并同意<a style="color:#f94270;cursor:pointer;" id="xieyiinfo">《用户注册及服务协议》</a></span>
			</div>
			<div  style="width:100%;height:50px;margin-top:15px;"> 
				<input id="log_trueimg" style="border:1px solid #fd4456;border-radius:8px;color:#fd4456;height:35px;width:280px;font-size:16px;background:#fff" value="注 册" type="button"  />
			</div>  
		</div> 
	</div>
	
	<!--foot-->
	#@homefoot1()
	#@homefoot2()
<script src="https://pv.sohu.com/cityjson?ie=utf-8"></script>  
<script>
	var ip_l=returnCitySN["cip"];
	//提交 
	function checkUserName(str) {
		var reg = /^[_0-9a-zA-Z\u4e00-\u9fa5]{1,10}$/;
		return reg.test(str);
	} 
	function checkmobile(str){
		var mobilereg = /^[1][3,4,5,7,8][0-9]{9}$/;
		return mobilereg.test(str);
	}
	$("#log_trueimg").click( function(){
		var passwords = $("#password").val();
		var mobiles = $("#mobile").val();
		var length = 12 - passwords.length;
		if($.isBlank($("#mobile").val())){
			layer.msg("注册手机号不能为空！",{icon:2,time:1000});
		}else if(!checkmobile(mobiles)){
			layer.msg("手机号格式不正确！",{icon:2,time:1000});
		}else{
			if(passwords.length < 6){
				layer.msg("密码长度不能小于6位！",{icon:2,time:1000}); 
			}else if(length < 0){
				layer.msg("密码长度不能大于12位！",{icon:2,time:1000}); 
			}else{
				if(!checkUserName(passwords)){
					layer.msg("密码只能为数字或字母！",{icon:2,time:1000}); 
				}else if($.isBlank($("#code").val())){
					layer.msg("验证码不能为空！",{icon:2,time:1000});
				}else if($('#xieyi').is(':checked')){
					ajax("#(path)/user/reg",{"referee":$("#referee").val(),"mobile":$("#mobile").val(),"password":$("#password").val(),"sms":$("#code").val(),"ip":ip_l,"type":"web"},function(data){
						if(data.code=='success'){
							layer.msg(data.msg,{icon:1,time:1000},function(){ 
								window.location.href="#(path)/user-useregauth"; 
							});
						}else{
							layer.msg(data.msg,{icon:2,time:1000});  
						}
					}); 
				}else{ 
					layer.msg("请确认已经阅读并同意《旺进财网站服务协议》！",{icon:2,time:1000});
				} 
			}
		} 
	});
	
	$("#xieyiinfo").click(function(){
		window.open("#(path)/user-userAgreement");
	});
	//获取验证码
	$("#log_getcode").click( function(){ 
		ajax("/sys/sendCode?type=reg",{"mobile":$("#mobile").val()},function(data1){
			if(data1.code=='success'){
				console.log(data1);
				time(log_getcode);
			}else{
				layer.msg(data1.msg,{icon:2,time:1000}); 
			}
		});
	});
	
	
	var wait=60;  
	function time(o) {  
		if (wait == 0) {  
			o.removeAttribute("disabled");            
			o.value="获取验证码";  
			wait = 60;  
		} else {  
			o.setAttribute("disabled", true);  
			o.value="(" + wait + ")";  
			wait--;  
			setTimeout(function() {  
				time(o)  
			},  
			1000)  
		}  
	}  
	 
	$("#log_forgeturl").click( function(){
		window.location.href="/app/page/user-forget";
	});
	$("#log_quxiao").click( function(){
		window.location.href="/app/page/user-index";
	});
	$("#log_renzheng").click( function(){
		window.location.href="/app/page/user-auth";
	});
</script>
</body>